package org.lc.stk.model.banks;

import java.util.List;

import org.hibernate.annotations.Comment;
import org.lc.stk.model.course.Course;

import jakarta.persistence.DiscriminatorValue;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.JoinTable;
import jakarta.persistence.ManyToMany;
import jakarta.persistence.Table;

@Entity
@Table(name = "multi_course_banks")
@DiscriminatorValue("2")  // 多课程试题库
public class MultiCourseBank extends SystemBank {

    @ManyToMany(fetch = FetchType.LAZY)
    @JoinTable(
        name = "multi_course_bank_courses",
        joinColumns = @JoinColumn(name = "bank_id"),
        inverseJoinColumns = @JoinColumn(name = "course_id")
    )
    @Comment("关联课程列表")
    private List<Course> courses;

    public List<Course> getCourses() {
        return courses;
    }

    public void setCourses(List<Course> courses) {
        this.courses = courses;
    }
}
